package com.eeepay.eeepay_v2.activity;

import com.eeepay.eeepay_v2.R;
import com.eeepay.eeepay_v2.model.DeviceInfo;
import com.eeepay.v2_library.ui.ABBaseActivity;
import com.eeepay.v2_library.view.LeftRightText;

/**
 * Created by zw on 2016/3/17 0017.
 * 机具详情
 */
public class DeviceDetailActivity extends ABBaseActivity{

    private LeftRightText lrt_SN, lrt_terminal, lrt_PSAM, lrt_deviceState, lrt_deviceModel, lrt_startTime, lrt_putTime, //机具信息
                         lrt_agentName, lrt_agentNo, // 代理商信息
                         lrt_merchant_number, lrt_merchant_name;//商户信息

    @Override
    protected int getLayoutId() {
        return R.layout.activity_device_detail;
    }

    @Override
    protected void initWidget() {
        lrt_SN = getViewById(R.id.lrv_device_sn);
        lrt_terminal = getViewById(R.id.lrv_terminal);
        lrt_PSAM = getViewById(R.id.lrv_psam);
        lrt_deviceState = getViewById(R.id.lrv_device_state);
        lrt_deviceModel = getViewById(R.id.lrv_device_model);
        lrt_startTime = getViewById(R.id.lrv_start_time);
        lrt_putTime = getViewById(R.id.lrv_put_time);

        lrt_agentName = getViewById(R.id.lrv_agent_name);
        lrt_agentNo = getViewById(R.id.lrv_agent_no);

        lrt_merchant_number = getViewById(R.id.lrv_merchant_number);
        lrt_merchant_name = getViewById(R.id.lrv_merchant_name);

        initData();

    }

    private void initData() {
        if(bundle != null){
            DeviceInfo data = (DeviceInfo) bundle.getSerializable("device_detail");
            lrt_SN.setRightText(data.getSN());
            lrt_PSAM.setRightText(data.getPasm());
            lrt_terminal.setRightText(data.getTerminal());
            lrt_deviceState.setRightText(data.getState());
            lrt_deviceModel.setRightText(data.getModel());
            lrt_startTime.setRightText(data.getStartTime());
            lrt_putTime.setRightText(data.getCreateTime());

            lrt_agentName.setRightText(data.getAgentName());
            lrt_agentNo.setRightText(data.getAgentNo());

            lrt_merchant_number.setRightText(data.getMerchantNo());
            lrt_merchant_name.setRightText(data.getMerchantName());

        }
    }

    @Override
    protected void eventOnClick() {

    }
}
